/**
 * @file src/ReadData.cpp
 *
 * @date 28-aug-2013
 *
 * @author Youri Hoogstrate
 * @author Lisa Yu
 *
 * @section LICENSE
 * yh-kt-fold can predict RNA 2D structures including K-turns.
 * Copyright (C) 2012-2013 Youri Hoogstrate
 *
 * This file is part of yh-kt-fold.
 *
 * yh-kt-fold is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * yh-kt-fold is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */



#include "main.h"
#include "Functions/library.h"

#include "MotifTree.h"



/**
 * @brief Reads the thermodynamic Gibbs energy parameters.
 *
 * @section DESCRIPTION
 * Read thermodynamics data (Turners dataset for now, Andronescu maybe
 * in the future?)
 *
 * The following variables are enlisted:
 * - asint3			Energy-values for A-symetrical interior loops (odd number of mismatches??)
 * - asint5			Energy-values for A-symetrical interior loops (odd number of mismatches??)
 * - bulge			Energy-values for bolge loops
 * - dangle
 * - eparam
 * - hairpin		Energy-values for hairpin loops
 * - inter			Energy-values for interior/internal loops
 * - poppen
 * - sint2			Energy-values for Symetrical interior loops	(2 stands probably for number of pairing surrounding the interior loop?)
 * - sint4			Energy-values for Symetrical interior loops	(4 stands probably for number of pairing surrounding the interior loop?)
 * - sint6			Energy-values for Symetrical interior loops	(6 stands probably for number of pairing surrounding the interior loop?)
 * - stack
 * - tloop
 * - triloop
 * - tstkh
 * - tstki
 * - prelog
 *
 * - kturns			List of all K-turns found in the data-file
 */
class ReadData
{
	public:
		float asint3[6][6][4][4][4],
		      //asint5[6][6][5][5][5][5][5],
		      bulge[30],
		      dangle[5][5][5][2],
		      eparam[16],
		      hairpin[30],
		      inter[30],
		      poppen[4],
		      sint2[6][6][5][5],
		      sint4[6][6][5][5][5][5],
		      sint6[6][6][25][5][5][5][5],
		      stack[5][5][5][5],
		      tloop[MAXTLOOPS][2],
		      triloop[MAXTRILOOPS][2],
		      tstkh[5][5][5][5],
		      tstki[5][5][5][5],
		      prelog;
		      
		KTurnMotif *kturns[MAXKTURNS];									/** @deprecated */
		MotifTree motifs;
		
		ReadData();
		~ReadData();
		
		char **get_datadirs(void);
		std::string *get_motifs_file(void);
		
		void read();
		void loadAsint3();
		//void loadAsint5();
		void loadBulge();
		void loadDangle();
		void loadEparamTurner();
		void loadEparamAndronescu();
		void loadEparam();
		void loadHairpin();
		void loadInternal();
		void loadPoppen();
		void loadSint2();
		void loadSint4();
		void loadSint6();
		void loadStack();
		void loadTloopTurner();
		void loadTloopAndronescu();
		void loadTloop();
		void loadTriloop();
		void loadTstkh();
		void loadTstki();
		void loadPrelog();
		void loadMotifs();
};
